//
//  SourceEditorCommand.swift
//  CXExtens
//
//  Created by 陈警卫 on 2023-12-28.
//

import Foundation
import XcodeKit

class SourceEditorCommand: NSObject, XCSourceEditorCommand {
    
    func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping (Error?) -> Void ) -> Void {
        
        let id = invocation.commandIdentifier
        if id == "MARK" {
            CXMarker.marker(invocation)
        } else if id == "JSON-Codable" {
            CXJSONFormat.apart(invocation)
        } else if id == "Translate" {
            CXTranslater.translater(invocation)
        }
        
        completionHandler(nil)
    }
    
}
